<?php
/**
 * Create by PhpStorm
 * User: lijia
 * Data: 2020/8/10
 * Time: 10:52
 */

namespace app\api\business;


use app\api\controller\UserCommon;
use app\api\model\Message;

class MessageBus extends UserCommon
{
    public $model;
    public function __construct(){
        parent::__construct();
        $this->model = new Message();
    }

    public function get(){
        $where = ['status' => 1];
        $list = $this->model->where($where)->order('id','desc')->field('title,content,create_time')->select()->toArray();
        foreach ($list as $k => $v){
            $list[$k]['create_time'] = date('m.d H:i',$v['create_time']);
        }
        return $list;
    }
}